package com.han.iterator;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName StudentAggregateImpl
 * @Description
 * @Author duoduo Han
 * @Date 2024/6/20 11:05
 */
public class StudentAggregateImpl implements Aggregate<Student>{
    private List<Student> students = new ArrayList<>();

    @Override
    public void add(Student o) {
        students.add(o);
    }

    @Override
    public void remove(Student o) {
        students.remove(o);
    }

    //
    @Override
    public Iterator getIterator() {
        return new StudentIteratorImpl(students);
    }
}
